home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / N-P / OmniScript 2.0.1 / Examples / Dialogs, Lists & Menus / Dialogs Lists and Menus < prev    next >
Encoding:
Text File  |  1993-09-30  |  1.7 KB  |  90 lines  |  [TEXT/ExPr]

  1. *    define a submenu
  2. *
  3. x = 'abc def ghijk/3<I lm'
  4. lval x,submenu
  5. menu new,21,-1,submenu
  6. *
  7. *    define a sample menu and add to menu bar
  8. *
  9. x = 'item1/1 item2/2 x'
  10. lval x,xsample
  11. xsample[3] = 'submenu/' #char(27) '!' #char(21)
  12. menu new,20,0,xsample
  13. menuscript 20,'MenuResponse'
  14. menuscript 21,'MenuResponse'
  15. *
  16. *    the dialog template is stored in the following file
  17. rfopen 'dialog resources',rfnum
  18. *
  19. *    the dialog displays the list ll created from a user selected directory
  20. *
  21. dir
  22. listdir ll
  23. list ll
  24. *
  25. *    items 3 & 4 form Group A Radio Buttons
  26. *    items 6 & 7 form Group A Radio Buttons
  27. *
  28. dloglist[3] = 'eGroup A #1'
  29. dloglist[4] = 'sGroup A #2'
  30. dloglist[5] = ''
  31. dloglist[6] = 'sGroup B #1'
  32. dloglist[7] = 'eGroup B #2'
  33. *
  34. *    item 13 is a pop-up menu initialized to show the second item in the list
  35. *
  36. menuset 20,2
  37. dloglist[13] = 21
  38. dloglist[14] = 'epop-up:'
  39. *
  40. *    item 15 is the directory list, using preselection
  41. *
  42. dloglist[15] = 'nn00ll'
  43. *
  44. *    item 16 is an arbitrary list without preselection
  45. *
  46. dloglist[16] = 'oN80aaa'
  47. x = '"item 1" "item 2" "item 3"'
  48. lval x,aaa
  49. *
  50. *show the dialog
  51. *
  52. debug off
  53. dialog dloglist,10
  54. *
  55. *    let's see which items were selected from the directory
  56. *
  57. listp ll
  58. listp aaa
  59. dloglist = 16
  60. list dloglist
  61. *
  62. *    let's see what happened to the radio buttons and check boxes
  63. *
  64. i = 3
  65. do while i < 8
  66.     display 'control ' i ' = ' dloglist[i]
  67.     inc i
  68. end
  69. *
  70. *    what happened to the edit text items
  71. *
  72. display 'edit text item  9 = 'dloglist[9]
  73. display 'edit text item 11 = 'dloglist[11]
  74. *
  75. *    which item did we select in the menu
  76. *
  77. display 'menuid 20 '#menu(20) ': menuid 21 '#menu(21)
  78. *
  79. *    how did we exit the dialog
  80. *
  81. if #ret
  82.     display 'you selected cancel'
  83. else
  84.     display 'you selected OK'
  85. end
  86. rfclose rfnum
  87. *
  88. script MenuResponse
  89. display 'MenuResponse: ' #arg(1)':'#arg(2)
  90.